package com.beimin.evedata.model.map;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class MapConstellationJumpId implements java.io.Serializable {
	private int fromConstellationId;
	private int toConstellationId;

	public MapConstellationJumpId() {
	}

	public MapConstellationJumpId(int fromConstellationId, int toConstellationId) {
		this.fromConstellationId = fromConstellationId;
		this.toConstellationId = toConstellationId;
	}

	@Column(name = "fromConstellationID", nullable = false)
	public int getFromConstellationId() {
		return this.fromConstellationId;
	}

	public void setFromConstellationId(int fromConstellationId) {
		this.fromConstellationId = fromConstellationId;
	}

	@Column(name = "toConstellationID", nullable = false)
	public int getToConstellationId() {
		return this.toConstellationId;
	}

	public void setToConstellationId(int toConstellationId) {
		this.toConstellationId = toConstellationId;
	}

	@Override
	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof MapConstellationJumpId))
			return false;
		MapConstellationJumpId castOther = (MapConstellationJumpId) other;

		return (this.getFromConstellationId() == castOther.getFromConstellationId()) && (this.getToConstellationId() == castOther.getToConstellationId());
	}

	@Override
	public int hashCode() {
		int result = 17;

		result = 37 * result + this.getFromConstellationId();
		result = 37 * result + this.getToConstellationId();
		return result;
	}

}
